<template>

  <div class="app-container">
    <el-form :model="showData" id="selectFormz" ref="showData" v-show="showSearch" label-width="100px" v-if="false">
      <div>
        <div style="background: #fff; padding: 20px; border-radius: 10px;border: 1px solid #eee;">
          <div style="font-size: 16px; margin-bottom: 20px;" class="big_title_style">
            平台信息信息
          </div>
          <el-form-item label="平台信息标题" style="margin-bottom:10px;">
            <span class="itemSpan">{{showData.cmsTitle }}</span>
          </el-form-item>
          <el-form-item label="平台信息分类" style="margin-bottom:10px;">
            <span class="itemSpan">{{ showData.cmsClassPname}} - {{ showData.cmsClassName}}</span>
          </el-form-item>
          <el-form-item label="状态" style="margin-bottom:10px;">
            <span class="itemSpan" v-if="showData.dataStatus == 1">有效</span>
            <span class="itemSpan" v-if="showData.dataStatus == 0">无效</span>
          </el-form-item>
          <el-form-item label="排序" style="margin-bottom:10px;">
            <span class="itemSpan">{{ showData.dataPriority}} </span>
          </el-form-item>
          <el-form-item label="创建人" style="margin-bottom:10px;">
            <span class="itemSpan">{{ showData.createName }}</span>
          </el-form-item>
          <el-form-item label="创建时间" style="margin-bottom:10px;">
            <span class="itemSpan">{{ parseTime(showData.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }} </span>
          </el-form-item>
          <el-form-item label="更新人" style="margin-bottom:10px;">
            <span class="itemSpan">{{ showData.updateName }}</span>
          </el-form-item>
          <el-form-item label="更新时间" style="margin-bottom:10px;">
            <span class="itemSpan">{{ parseTime(showData.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }} </span>
          </el-form-item>
          <el-form-item label="发布人" style="margin-bottom:10px;">
            <span class="itemSpan">{{ showData.publishName }}</span>
          </el-form-item>
          <el-form-item label="发布时间" style="margin-bottom:10px;">
            <span class="itemSpan">{{ parseTime(showData.publishTime, '{y}-{m}-{d} {h}:{i}:{s}') }} </span>
          </el-form-item>
          <el-form-item label="平台信息Banner" style="min-height: 92px; width: 910px">
            <el-image :z-index="zIndex" v-if="showData.titleImgUrl!= '' && showData.titleImgUrl!=null"
              :src="showData.titleImgUrl" style="
                width: 80px;
                height: 80px;
                margin-left: 10px;
                margin-top: 10px;
                border: 1px solid #ebebeb;
                border-radius: 6px;
              ">
            </el-image>
          </el-form-item>
          <el-form-item label="视频" style="min-height: 92px">
            <video :z-index="zIndex" style="
                width: 80px;
                height: 80px;
                margin-left: 10px;
                margin-top: 10px;
                border: 1px solid #ebebeb;
                border-radius: 6px;
              " v-if="
                showData.carouselVedio != '' && showData.carouselVedio != null
              " :src="showData.carouselVedio" controls="controls">
              您的浏览器不支持视频播放
            </video>
          </el-form-item>
          <el-form-item label="平台信息内容" style="margin-bottom:10px;">
            <div class="itemSpan" v-html="showData.cmsContent"></div>
          </el-form-item>
        </div>
      </div>
    </el-form>

    <div class="show_content">
      <!-- <div style="font-size: 16px;margin-bottom: 20px;" class="big_title_style">公告信息</div> -->
      <div class="info_title">{{showData.cmsTitle }}</div>
      <div class="info_data">
        <div class="item_info_data">{{ showData.cmsClassPname}} - {{ showData.cmsClassName}}</div>
        <div class="item_info_data">发布：{{ parseTime(showData.publishTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</div>
        <div class="item_info_data">{{showData.dataStatus == 1? '有效': '无效'}}</div>
      </div>
      <div class="info_content">
        <div class="show_video" v-if="showData.carouselVedio != '' && showData.carouselVedio != null">
            <video :z-index="zIndex" :src="showData.carouselVedio" controls="controls">
                您的浏览器不支持视频播放
            </video>
        </div>
        <div class="show_img" v-if="showData.titleImgUrl!= '' && showData.titleImgUrl!=null">
            <el-image :z-index="zIndex" style="width: 100%;height: auto"
                :src="showData.titleImgUrl" >
            </el-image>
        </div>
        <div class="show_text" v-html="showData.cmsContent"></div>
      </div>
    </div>
  </div>
</template>

<script>
  import {
    getCmsUid,
    addCms,
    updateCms,
  } from "@/api/platform/cms";
  export default {
    name: "platformDetail",
    data() {
      return {
        showSearch: true,
        zIndex: 2000,
        showData: {},

      }
    },
    created() {

      const cmsUid = this.$route.params && this.$route.params.cmsUid;
      if (cmsUid) {
        getCmsUid(cmsUid).then(response => {
          this.showData = response.data;
        });
      }
    },
    methods: {

    },
  }
</script>

<style scoped="scoped" lang="scss">
  .app-container {
    width: 1000px;
    margin: 0 auto;
  }
  .itemSpan {
    font-size: 14px;
    color: #606266;
  }

  .show_content {
    background: #fff; 
    padding: 50px; 
    border-radius: 10px;
    border: 1px solid #eee;
    min-height: 600px;
  }
  .info_title {
    font-size: 24px;
    color: #000;
  }
  .info_data {
    margin-top: 15px;
    display: flex;
    align-items: center;
    .item_info_data {
      padding-right: 20px;
      font-size: 12px;
      color: #999;
      &:not(:first-child) {
        padding-left: 20px;
      }
      &:not(:last-child) {
        border-right: 1px solid #eee;
      }
    }
  }
  .info_content {
    margin-top: 40px;
    .show_video {
      width: 500px;
      height: auto;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 20px auto 0;
      video {
        width: 100%;
        height: 100%;
        display: block;
      }
    }
    .show_img {
      width: 100%;
      height: auto;
      margin-top: 20px;
      img {
        width: 100%;
        height: auto;
      }
    }
    .show_text {
      margin-top: 20px;
      font-size: 16px;
      color: #333;
      line-height: 26px;
    }
  }
</style>
